-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(whl_library): remove --no-index
and add --no-build-isolation
when build sdist
#2126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the proposed fix!
I guess if we want to ensure that no PyPI index is contacted when we build wheels, we would have to also have to include steuptools path here at the minimum. But then some wheels may require more than that.
The correct long term fix would be to move the build of the wheels to the build phase and use proper toolchains, but for now it is good enough.
@dougthor42 could you let me know if that breaks/fixes build with 0.35 in your project? Since you are using private indexes, I am would love to have more data before merging and tagging 0.35.1.
I am also using a private Google artifact registry with 0.35.0., and so far, no issues. |
I just ran into this issue as well after upgrading to 0.35. Using
worked for me. I am also using a private Google Artifact Registry pypi index. |
Seeing a strange behaviour, this works locally but fails in CI with hosted Github actions runner
|
Ack 👍 . I hope to test this by the end of the week. |
a239635
to
9bafcbd
Compare
By the way, to test if the PR fixes #2118, one should be able to do the following: bazel build --@rules_python//python/config_settings:pip_whl=no //:all_requirements Within the $ bazel build --@rules_python//python/config_settings:pip_whl=no //:all_requirements
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.4.1, but got bazel_skylib@1.6.1 in the resolved dependency graph.
WARNING: For repository 'rules_proto', the root module requires module version rules_proto@5.3.0-21.7, but got rules_proto@6.0.0-rc1 in the resolved dependency graph.
WARNING: Build option --@@rules_python~//python/config_settings:pip_whl has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: Repository rules_python~~pip~pip_39_pathspec_sdist_56200de4 instantiated at:
<builtin>: in <toplevel>
Repository rule whl_library defined at:
/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_library.bzl:451:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'rules_python~~pip~pip_39_pathspec_sdist_56200de4':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_library.bzl", line 243, column 35, in _whl_library_impl
repo_utils.execute_checked(
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/repo_utils.bzl", line 212, column 29, in _execute_checked
return _execute_internal(fail_on_error = True, *args, **kwargs)
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/repo_utils.bzl", line 143, column 20, in _execute_internal
logger.fail((
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/repo_utils.bzl", line 85, column 39, in lambda
fail = lambda message_cb: _log(-1, "FAIL", message_cb, fail),
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/repo_utils.bzl", line 75, column 16, in _log
printer("\nrules_python:{} {}:".format(
Error in fail:
rules_python:whl_library(@@rules_python~~pip~pip_39_pathspec_sdist_56200de4) FAIL: repo.execute: whl_library.BuildWheelFromSource(rules_python~~pip~pip_39_pathspec_sdist_56200de4, pathspec==0.10.3): end: f
ailure:
command: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/python -m python.private.pypi.whl_installer.wheel_installer --requirement
pathspec==0.10.3 --isolated --extra_pip_args "{\"arg\":[\"--no-index\",\"--find-links\",\".\"]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}"
return code: 1
working dir: <default: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip_39_pathspec_sdist_56200de4>
timeout: 600
environment:
PYTHONPATH="/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_pytho
n~~internal_deps~pypi__build:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__click:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d
08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__colorama:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__importlib_me
tadata:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__installer:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb
5025/external/rules_python~~internal_deps~pypi__more_itertools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__packaging:/private/var/t
mp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pep517:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_pyth
on~~internal_deps~pypi__pip:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pip_tools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5
d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pyproject_hooks:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__se
tuptools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__tomli:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb50
25/external/rules_python~~internal_deps~pypi__wheel:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -isystem /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/inc
lude/python3.9"
===== stdout start =====
Looking in links: .
Processing ./pathspec-0.10.3.tar.gz (from -r /var/folders/nq/dvvx_cwj0d1bqv6jjntc63r40000gr/T/tmphctvbdpw (line 1))
File was already downloaded /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip_39_pathspec_sdist_56200de4/pathspec-0.10.3.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
===== stdout end =====
===== stderr start =====
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
Looking in links: .
ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
ERROR: No matching distribution found for setuptools>=40.8.0
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_installer/wheel_installer.py", line 205, in <module>
main()
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_installer/wheel_installer.py", line 190, in main
subprocess.run(pip_args, check=True, env=env)
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/python', '-m', 'pip', '--isolated', 'wheel
', '--no-deps', '--no-index', '--find-links', '.', '-r', '/var/folders/nq/dvvx_cwj0d1bqv6jjntc63r40000gr/T/tmphctvbdpw']' returned non-zero exit status 1.
===== stderr end =====
ERROR: no such package '@@rules_python~~pip~pip_39_pathspec_sdist_56200de4//':
rules_python:whl_library(@@rules_python~~pip~pip_39_pathspec_sdist_56200de4) FAIL: repo.execute: whl_library.BuildWheelFromSource(rules_python~~pip~pip_39_pathspec_sdist_56200de4, pathspec==0.10.3): end: f
ailure:
command: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/python -m python.private.pypi.whl_installer.wheel_installer --requirement
pathspec==0.10.3 --isolated --extra_pip_args "{\"arg\":[\"--no-index\",\"--find-links\",\".\"]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}"
return code: 1
working dir: <default: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip_39_pathspec_sdist_56200de4>
timeout: 600
environment:
PYTHONPATH="/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_pytho
n~~internal_deps~pypi__build:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__click:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d
08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__colorama:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__importlib_me
tadata:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__installer:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb
5025/external/rules_python~~internal_deps~pypi__more_itertools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__packaging:/private/var/t
mp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pep517:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_pyth
on~~internal_deps~pypi__pip:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pip_tools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5
d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pyproject_hooks:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__se
tuptools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__tomli:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb50
25/external/rules_python~~internal_deps~pypi__wheel:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -isystem /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/inc
lude/python3.9"
===== stdout start =====
Looking in links: .
Processing ./pathspec-0.10.3.tar.gz (from -r /var/folders/nq/dvvx_cwj0d1bqv6jjntc63r40000gr/T/tmphctvbdpw (line 1))
File was already downloaded /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip_39_pathspec_sdist_56200de4/pathspec-0.10.3.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
===== stdout end =====
===== stderr start =====
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
Looking in links: .
ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
ERROR: No matching distribution found for setuptools>=40.8.0
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_installer/wheel_installer.py", line 205, in <module>
main()
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_installer/wheel_installer.py", line 190, in main
subprocess.run(pip_args, check=True, env=env)
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/python', '-m', 'pip', '--isolated', 'wheel
', '--no-deps', '--no-index', '--find-links', '.', '-r', '/var/folders/nq/dvvx_cwj0d1bqv6jjntc63r40000gr/T/tmphctvbdpw']' returned non-zero exit status 1.
===== stderr end =====
ERROR: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip/pathspec/BUILD.bazel:31:6: @@rules_python~~pip~pip//pathspec:pkg depends on @@rules_python~~
pip~pip_39_pathspec_sdist_56200de4//:pkg in repository @@rules_python~~pip~pip_39_pathspec_sdist_56200de4 which failed to fetch. no such package '@@rules_python~~pip~pip_39_pathspec_sdist_56200de4//':
rules_python:whl_library(@@rules_python~~pip~pip_39_pathspec_sdist_56200de4) FAIL: repo.execute: whl_library.BuildWheelFromSource(rules_python~~pip~pip_39_pathspec_sdist_56200de4, pathspec==0.10.3): end: f
ailure:
command: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/python -m python.private.pypi.whl_installer.wheel_installer --requirement
pathspec==0.10.3 --isolated --extra_pip_args "{\"arg\":[\"--no-index\",\"--find-links\",\".\"]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}"
return code: 1
working dir: <default: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip_39_pathspec_sdist_56200de4>
timeout: 600
environment:
PYTHONPATH="/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_pytho
n~~internal_deps~pypi__build:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__click:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d
08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__colorama:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__importlib_me
tadata:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__installer:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb
5025/external/rules_python~~internal_deps~pypi__more_itertools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__packaging:/private/var/t
mp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pep517:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_pyth
on~~internal_deps~pypi__pip:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pip_tools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5
d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__pyproject_hooks:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__se
tuptools:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__tomli:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb50
25/external/rules_python~~internal_deps~pypi__wheel:/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~internal_deps~pypi__zipp"
CPPFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -isystem /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/inc
lude/python3.9"
===== stdout start =====
Looking in links: .
Processing ./pathspec-0.10.3.tar.gz (from -r /var/folders/nq/dvvx_cwj0d1bqv6jjntc63r40000gr/T/tmphctvbdpw (line 1))
File was already downloaded /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip_39_pathspec_sdist_56200de4/pathspec-0.10.3.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
===== stdout end =====
===== stderr start =====
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [3 lines of output]
Looking in links: .
ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
ERROR: No matching distribution found for setuptools>=40.8.0
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_installer/wheel_installer.py", line 205, in <module>
main()
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/whl_installer/wheel_installer.py", line 190, in main
subprocess.run(pip_args, check=True, env=env)
File "/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_x86_64-apple-darwin/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~python~python_3_9_host/python', '-m', 'pip', '--isolated', 'wheel
', '--no-deps', '--no-index', '--find-links', '.', '-r', '/var/folders/nq/dvvx_cwj0d1bqv6jjntc63r40000gr/T/tmphctvbdpw']' returned non-zero exit status 1.
===== stderr end =====
ERROR: Analysis of target '//:all_requirements' failed; build aborted: Analysis failed
INFO: Elapsed time: 23.853s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
Fetching repository @@rules_python~~pip~pip_39_pyyaml_sdist_bfdf460b; starting 19s
Fetching repository @@rules_python~~pip~pip_39_zipp_sdist_84e64a1c; starting 19s
Fetching repository @@rules_python~~pip~pip_39_certifi_sdist_539cc1d1; starting 19s
Fetching repository @@rules_python~~pip~pip_39_colorama_sdist_08695f5c; starting 19s
Fetching repository @@rules_python~~pip~pip_39_isort_sdist_6db30c5d; starting 19s
Fetching repository @@rules_python~~pip~pip_39_websockets_sdist_88fc51d9; starting 19s
Fetching repository @@rules_python~~pip~pip_39_python_dateutil_sdist_0123cacc; starting 19s
Fetching repository @@rules_python~~pip~pip_39_python_magic_sdist_c1ba14b0; starting 19s ... (46 fetches) And this branch: $ bazel build --@rules_python//python/config_settings:pip_whl=no //:all_requirements
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.4.1, but got bazel_skylib@1.6.1 in the resolved dependency graph.
WARNING: For repository 'rules_proto', the root module requires module version rules_proto@5.3.0-21.7, but got rules_proto@6.0.0-rc1 in the resolved dependency graph.
DEBUG: /private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~/python/private/pypi/patch_whl.bzl:109:14: WARNING: the resultant RECORD file of the patch wheel is different
If you are patching on Windows, you may see this warning because of
a known issue (bazelbuild/rules_python#1639) with file endings.
If you would like to silence the warning, you can apply the patch that is stored in
/private/var/tmp/_bazel_ignas.anikevicius/ee423e5d9d08c035dfd0b914eadb5025/external/rules_python~~pip~pip_39_requests_sdist_27973dd4/RECORD.patch. The contents of the file are below:
--- a/requests-2.25.1.dist-info/RECORD
+++ b/requests-2.25.1.dist-info/RECORD
@@ -16,6 +16,7 @@
requests/status_codes.py,sha256=gT79Pbs_cQjBgp-fvrUgg1dn2DQO32bDj4TInjnMPSc,4188
requests/structures.py,sha256=msAtr9mq1JxHd-JRyiILfdFlpbJwvvFuP3rfUQT_QxE,3005
requests/utils.py,sha256=_K9AgkN6efPe-a-zgZurXzds5PBC0CzDkyjAE2oCQFQ,30529
+requests-2.25.1.tar.gz,sha256=J5c91KkEpPE7JjoZyGbBO5KjntHJZGVfAl8_jT11uAQ,102161
requests-2.25.1.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
requests-2.25.1.dist-info/METADATA,sha256=fRSAA0u0Bi0heD4zYq91wdNUTJlbzhK6_iDOcRRNDx4,4177
requests-2.25.1.dist-info/WHEEL,sha256=Z-nyYpwrcSqxfdux5Mbn_DQ525iP7J2DG3JgGvOYyTQ,110
INFO: Analyzed target //:all_requirements (49 packages loaded, 3971 targets configured).
INFO: Found 1 target...
Target //:all_requirements up-to-date:
bazel-bin/all_requirements.sh
INFO: Elapsed time: 41.071s, Critical Path: 0.22s
INFO: 43 processes: 2 internal, 41 darwin-sandbox.
INFO: Build completed successfully, 43 total actions So the only remaining thing from my point of view for this PR is to ensure that the EDIT: I think it would be good to also add a test that transitions |
9bafcbd
to
4efee77
Compare
023524e
to
893539c
Compare
893539c
to
fb3c56d
Compare
I tested using commit fb3c56d. Everything looked good for us. 🎉 |
--no-index
and add --no-build-isolation
when build sdist
I have made some minor adjustments:
I tried adding back the |
@dougthor42 was curious how this played out in your org in general. It did not end well for us; random packages could not be built on random machines at random times. I endded up uploading all the missing wheels to mitigate the issues. |
@ewianda sorry for taking so long to reply here. We only updated to I'm happy to report that we haven't had any issues! |
Fixes #2328. In #2126, we discussed and added `--no-build-isolation` to ensure that sdist builds pulled from rules_python supplied dependencies. An unanticipated/misunderstood side-effect of this is that pip will no longer resolve necessary, declared build time dependencies from a package index. That's a significant point of friction for users, and, it's much harder to opt-out of the behavior than to opt-in given the presence of `extra_pip_args`.
Building sdist results in
Could not find a version that satisfies the requirement setuptool
this regressed when a fix in parameter handlinggot introduced in #2091.
Before this change the building from sdist when using
experimental_index_url
would break because
--no-index
is passed topip
. This means thatpip
would fail to locate build time dependencies needed for the packages and would
just not work. In
whl_library
we setupPYTHONPATH
to have some builddependencies available (like
setuptools
) and we could use them duringbuilding from
sdist
and to do so we need to add--no-build-isolation
flag.However, for some cases we need to also add other build-time dependencies (e.g.
flit_core
) so that the building of the wheel in therepository_rule
contextis successfuly. Removing
--no-index
allowspip
to silently fetch the neededbuild dependencies from PyPI if they are missing and continue with the build.
This is not a perfect solution, but it does unblock users to use the
sdist
distributions with the experimental feature enabled by using
experimental_index_url
(see #260 for tracking of the completion).Fixes #2118
Fixes #2152